package com.boho.base.dao;

/**
 * @File name:  TgfileDao.java
 * @Create on:  2010-5-10
 * @Author   :  陈伟
 *
 * @ChangeList
 * ---------------------------------------------------
 * Date         Editor              ChangeReasons
 *
 */


import java.sql.Connection;

import cn.boho.framework.po.CQuery;
import cn.boho.framework.po.CQueryFactoryTool;
import cn.boho.framework.po.DAO;
import cn.boho.framework.po.DynaBeanMap;

/**
 * 【文件信息:TG_FILE】的Dao操作类
 * 
 */

public class TgfileDao extends DAO {

	/**
	 * 根据主键【文件编号:PICFILE_NO|】获得信息
	 * 
	 * @param con
	 * @param picfileNo
	 *            文件编号
	 * @return
	 * @throws Exception
	 * @author 陈伟
	 * 
	 */
	@SuppressWarnings("unchecked")
	public static DynaBeanMap getTgfileByPk(Connection con,
			java.lang.String picfileNo) throws Exception {
		DynaBeanMap dynaBeanMap = null;
		StringBuffer sql = new StringBuffer();
		sql
				.append("select PICFILE_NO,FILE_NAME,ORIGIN_FILE_NAME,FILE_SUFFIX,DOMAIN_NAME,FILE_CATALOG,FILE_SIZE,CHECK_RESULT from TG_FILE where PICFILE_NO=?");
		CQuery query = CQueryFactoryTool.createFactory().createCQuery();
		query.setCommand(sql.toString());
		query.setString(1, picfileNo == null ? "" : picfileNo);
		dynaBeanMap = query.getDynaBeanMap("TG_FILE", con);
		logger.debug("TgfileDao.TgfileDao():" + query.getCommand());
		return dynaBeanMap;
	}
}
